<template>
	<view>
		<view class="signin-record" v-if="detail.signList && detail.signList.length > 0">
			<view v-for="(item,index) in detail.signList" :key="index" class="signin-record-item">
				<view class="d-b-c mb20">
					<view class="f28">签到奖励</view>
					<view class="gray9">{{item.createTime}}</view>
				</view>
				<view class="f24 d-s-c f-w">
					<view v-for="(citem,cindex) in item.coupon" :key="cindex" class="d-s-c f24">
						<image class="thisWeek-points" src="/static/signin/coupon.png" mode=""></image>
						{{citem.name}}<text class="f24 gray9">x{{citem.couponNum}}</text><text class="m-0-10"
							v-if="(cindex!=item.coupon.length-1) || item.points">+</text>
					</view>
					<view v-if="item.points" class="d-s-c">
						<image class="thisWeek-points" src="/static/signin/signin-points.png" mode=""></image>
						{{item.points}}积分
					</view>
				</view>
			</view>
		</view>
		<view class="f26 d-c-c" v-else>暂无记录....</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				detail: {
					signList: []
				}
			}
		},
		onLoad() {
			this.getData()
		},
		methods: {
			/*获取数据*/
			getData() {
				let self = this;
				uni.showLoading({
					title: '加载中'
				});
				self._get('plus/sign/sign/index', {}, function(res) {
					self.detail = res.data;
					self.loading = false;
					uni.hideLoading();
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.signin-record {
		width: 702rpx;
		background: #FFFFFF;
		border-radius: 25rpx;
		padding: 35rpx 18rpx 35rpx 18rpx;
		box-sizing: border-box;
		margin: auto;
		margin-bottom: 20rpx;
		margin-top: 20rpx;

		.signin-record-item {
			border-bottom: 1px solid #eee;
			padding: 30rpx 0 13rpx 0;
		}

		.signin-record-item:last-child {
			border: none;
		}

		.thisWeek-points {
			width: 29rpx;
			height: 29rpx;
			margin-right: 6rpx;
			display: block;
		}
	}
</style>